<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "stock_warehouse".
 *
 * @property int $id
 * @property string $title 库存名称
 * @property string $created_time 创建时间
 * @property string $updated_time 更新时间
 * @property int $state 1正常0不显示
 */
class StockWarehouse extends \yii\db\ActiveRecord
{

    //  定义仓库可用状态
    const STATE_VALID = 1;
    const STATE_INVALID = 0;

    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'stock_warehouse';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['uid','tally_id'], 'integer'],
            [['created_time', 'updated_time'], 'safe'],
            [['state'], 'integer'],
            [['title'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'uid' => 'UID',
            'tally_id' => 'Tally Id',
            'title' => 'Title',
            'created_time' => 'Created Time',
            'updated_time' => 'Updated Time',
            'state' => 'State',
        ];
    }
}
